// 图片下载 blob转url
export const blobToUrl = async (blobRes: Blob): Promise<string> => {  
  return new Promise((resolve, reject) => {  
    let reader = new FileReader()
    reader.readAsArrayBuffer(blobRes)
    reader.onload = (e: any) => {  
      const result = e.target.result  
      const contentType = blobRes.type 
      const blob = new Blob([result], { type: contentType })
      const url = window.URL.createObjectURL(blob)
      resolve(url)
    }
    reader.onerror = (error) => {  
      reject(error)
    }
  })
}